﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RapidDict.Modules.HotKeyServiceModule.cs" company="WordSteps.com">
//   All rights reserved
// </copyright>
// <summary>
//   Defines the Module type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace RapidDict.Modules.HotKeyService
{
    using Microsoft.Practices.Composite.Modularity;
    using Microsoft.Practices.Unity;
    using RapidDict.Infrastructure.Interfaces;

    [Module(ModuleName = "HotKeyServiceModule")]
    [ModuleDependency("TranslationServiceModule")]
    public class HotKeyServiceModule : IModule
    {
        IUnityContainer container;

        public HotKeyServiceModule(IUnityContainer container)
        {
            this.container = container;
        }

        public void Initialize()
        {
            var appViewService = this.container.Resolve<IAppViewService>();
            var translationService = this.container.Resolve<ITranslationService>();

            this.container.RegisterInstance<IHotKeyService>(new Services.HotKeyService(appViewService, translationService));
        }
    }
}